package com.taosdata.example.springbootdemo.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.baomidou.dynamic.datasource.annotation.DS;
//import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.taosdata.example.springbootdemo.domain.ParkingLotCount;

@Mapper
@DS("tdengine")
public interface ParkingLotCountMapper extends BaseMapper<ParkingLotCount>{
	
	/**
	 * 创建超级表
	 */
	void createSuperTable();
	
	/**

	/**
	 * ts, total_count,left_count,AS used_count
	 * @param projectId
	 * @param lotIdList
	 * @param beginDatetime
	 * @param endDatetime
	 * @param interval 毫秒
	 * @return
	 */
	List<Map<String, Object>> leftCountHistory(@Param("projectId") Long projectId, 
			@Param("lotIds")List<Long> lotIds, 
			@Param("beginDatetime")String beginDatetime, 
			@Param("endDatetime")String endDatetime,
			@Param("interval") Integer interval
			);

	List<Map<String, Object>> leftCountHistoryDetail(@Param("projectId") Long projectId, 
			@Param("lotIds")List<Long> lotIds, 
			@Param("beginDatetime")String beginDatetime, 
			@Param("endDatetime")String endDatetime,
			@Param("interval") Integer interval
			);

}
